package behavioral.chainOfResponsibility;

public class ChainOfResponsibilityPattern {
    public static void main(String[] args) {
        // Create the chain of handlers
        // Authentication -> Compression -> Logging
        Handler logger = new Logger();
        Handler compressor = new Compressor(logger);
        Handler authenticator = new Authenticator(compressor);

        // Create the web server with the handler chain
        WebServer webServer = new WebServer(authenticator);

        // Create a sample HTTP request
        HttpRequest request = new HttpRequest("admin", "1234");

        // Handle the request
        webServer.handleRequest(request);
    }
}
